package cn.tedu.ivoscm.user.pojo.dto;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.Email;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.Date;

@Data
public class UserSaveParam {
    @ApiModelProperty(value = "用户id")
    private Long id;

    @ApiModelProperty(value = "用户名")
    @NotBlank(message = "用户名不能为空")
    private String username;

    @ApiModelProperty(value = "邮箱")
    @Email(message = "邮箱格式不正确")
    @NotNull(message = "邮箱不能为空")
    private String email;

    @ApiModelProperty(value = "手机号")
    @Size(min = 11, max = 11, message = "手机号格式不正确")
    @NotNull(message = "手机号不能为空")
    private String phone;

    @ApiModelProperty(value = "年龄")
    @Range(min = 1, max = 200, message = "年龄格式不正确")
    @NotNull(message = "年龄不能为空")
    private Integer age;

    @ApiModelProperty(value = "性别")
    @NotBlank(message = "性别不能为空")
    private String gender;

    @ApiModelProperty(value = "用户状态")
    @NotBlank(message = "用户状态不能为空")
    private String status;

    @ApiModelProperty(value = "用户职级")
    @NotBlank(message = "用户职级不能为空")
    private String level;//10员工 20经理 30总监 40总裁

    @ApiModelProperty(value = "上级id")
    @NotNull(message = "上级id不能为空")
    private Long parentId;//自关联字段,上级id也是上级这个人自己的用户id
}